import { getS210motorList, getV90motorList } from '@/services/sales/salesNeedInfo';
import type { ProFormInstance } from '@ant-design/pro-components';
import {
  ModalForm,
  ProCard,
  ProFormDependency,
  ProFormDigit,
  ProFormGroup,
  ProFormSelect,
  ProFormText,
  ProForm,
} from '@ant-design/pro-components';
import { Select } from 'antd';
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
import type { FormDialogProps } from './data';
import type { FormLayout } from 'antd/es/form/Form';
const { Option } = Select;

const rowNullData = {
  motorId: null, //电机ID
  ratedCurrent: null, //额定电流(A)
  ratedTorque: null, //额定扭矩(Nm)
  ratedPower: null, //额定功率(KW)
  ecoderType: null, //编码器
  brake: null, //抱闸
  ratedSpeed: null, //额定速度(rpm)
  ratedVoltage: null, //额定电压(V)
  motorInertia: null, //电机惯量(10^-4kg·cm2)
};
const LAYOUT_TYPE_HORIZONTAL = 'horizontal';
const DriveParaCalc: React.FC<FormDialogProps> = (props, uploadRef) => {
  const [visible, setVisible] = useState(false);
  const formRef = useRef<ProFormInstance>();
  const [disabled, setDisabled] = useState(false);
  const [confirmLoading, setConfirmLoading] = useState(false);
  const [initialValues, setInitialValues] = useState({});
  const [controlMode, setControlMode] = useState(0);

  const [formLayoutType, setFormLayoutType] = useState<FormLayout>(LAYOUT_TYPE_HORIZONTAL);
  const [grid, setGrid] = useState(true);

  useEffect(() => {
    setVisible(props.visible);
    setDisabled(props.disabled);
    setInitialValues(props.initialValues || {});
    console.log(props.initialValues, '---props.initialValues---');
  }, [props.visible, props.disabled, props.initialValues]);

  useEffect(() => {
    formRef.current?.setFieldsValue(props.values);
  }, [props.values]);

  useImperativeHandle(uploadRef, () => {
    // return返回的值就可以被父组件获取到,没返回的值就获取不到
    return {
      // 获取其中的值
      getFieldsValue: () => {
        return formRef.current?.getFieldsValue();
      },
      // 设置值
      setFieldsValue: (value: object) => {
        // console.log(formRef.current);
        // debugger;
        return formRef.current?.setFieldsValue({ shaftName: '测试', hardwareIdentifier: 'hhh' });
      },
      // 重置其中的值
      resetFields: () => {
        return formRef.current?.resetFields();
      },
    };
  });

  return (
    <div>
      {/* <Modal
        title={props.title}
        confirmLoading={confirmLoading}
        visible={visible}
        onOk={async () => {
          // 需要加loading
          setConfirmLoading(true);
          await props.onOk();
          setConfirmLoading(false);
        }}
        onCancel={() => {
          props.onCancel();
        }}
      > */}
      <ModalForm
        title={props.title}
        visible={visible}
        formRef={formRef}
        initialValues={initialValues}
        onFinish={async () => {
          setConfirmLoading(true);
          await props.onOk();
          setConfirmLoading(false);
          return true;
        }}
        onValuesChange={(changeValues) => {
          if (changeValues.controlMode !== null && changeValues.controlMode !== undefined) {
            setControlMode(changeValues.controlMode);
          }
          console.log(changeValues.stackerType, '---stackerType---');
        }}
        modalProps={{
          destroyOnClose: true,
          onCancel: () => props.onCancel(),
        }}
        layout={formLayoutType}
        grid={grid}
        rowProps={{
          gutter: [16, formLayoutType === 'inline' ? 16 : 0],
        }}
        // submitter={{
        //   searchConfig: {
        //     resetText: '重置',
        //   },
        //   resetButtonProps: {
        //     onClick: () => {
        //       formRef.current?.setFieldsValue({ shaftName: '测试', hardwareIdentifier: 'hhh' });
        //       // formRef.current?.resetFields();
        //       //   setModalVisible(false);
        //     },
        //   },
        // }}
        // onOpenChange={() => {

        // }}
        // onOpenChange={setVisible}
      >
        <ProFormSelect
          // options={[
          //   {
          //     value: 'chapter',
          //     label: '盖章后生效',
          //   },
          // ]}
          fieldProps={{
            //这里使用了select的onChange方法，必须使用这样的写法来进行调用onChange方法
            onChange: (val, val2) => {},
          }}
          hidden={true}
          colProps={{ md: 12, xl: 6 }}
          name="stackerType"
          label="设备类型"
          options={[
            { label: '基础版本', value: 1 },
            { label: '堆垛机:单立柱-单载', value: 11 },
            { label: '堆垛机:双立柱-单载', value: 12 },
            { label: '堆垛机:双立柱-双载', value: 13 },
            { label: '堆垛机:转弯堆垛机', value: 14 },
            { label: '堆垛机:其它', value: 15 },
          ]}
        />
        <ProFormText
          // options={[
          //   {
          //     value: 'chapter',
          //     label: '盖章后生效',
          //   },
          // ]}

          hidden={true}
          name="id"
          label="轴信息Id"
        />
        <ProFormDependency name={['stackerType']}>
          {({ stackerType }) => {
            if (stackerType > 10 && stackerType < 19) {
              return [
                <ProFormGroup key="common" title="基础信息配置">
                  <ProFormText
                    width="md"
                    name="shaftName"
                    label="轴名称"
                    colProps={{ md: 12, xl: 8 }}
                    rules={[{ required: true, message: '请输入轴名称信息' }]}
                  />
                  <ProFormDigit
                    width="md"
                    name="velocityMax"
                    label="最大速度"
                    colProps={{ md: 12, xl: 8 }}
                  />
                  <ProFormDigit
                    width="md"
                    name="accelerationMax"
                    label="最大加速度"
                    colProps={{ md: 12, xl: 8 }}
                  />
                  <ProFormDigit
                    width="md"
                    name="gearRationMotor"
                    label="齿轮比电机"
                    initialValue={1}
                    colProps={{ md: 12, xl: 8 }}
                  />
                  <ProFormDigit
                    width="md"
                    name="gearRationLoad"
                    label="齿轮比负载"
                    initialValue={1}
                    colProps={{ md: 12, xl: 8 }}
                  />
                  <ProFormDigit
                    width="md"
                    name="loadOneTurnDistance"
                    label="负载一圈的距离(mm)"
                    colProps={{ md: 12, xl: 8 }}
                  />
                  <ProFormSelect
                    width="md"
                    name="driveType"
                    label="驱动类型"
                    options={[
                      { label: 'G120 CU250S-2', value: 1 },
                      { label: 'G120 CU240E-2', value: 2 },
                      { label: 'G120C', value: 3 },
                      { label: 'S120 CU320-2', value: 4 },
                      { label: 'S120 CU310-2', value: 5 },
                      { label: 'V90', value: 6 },
                      { label: 'Others', value: 0 },
                    ]}
                    colProps={{ md: 12, xl: 8 }}
                    rules={[{ required: true, message: '此项是必填项目' }]}
                  />
                  <ProFormSelect
                    width="md"
                    name="controlMode"
                    label="控制模式"
                    options={[
                      { label: 'Epos定位', value: 1 },
                      { label: '速度闭环控制', value: 2 },
                      { label: '无编码器矢量控制', value: 3 },
                      { label: 'V/F', value: 4 },
                    ]}
                    colProps={{ md: 12, xl: 8 }}
                    rules={[{ required: true, message: '此项是必填项目' }]}
                  />
                  <ProFormSelect
                    width="md"
                    name="workMotorWiring"
                    label="工作时电机接线方式"
                    options={[
                      { label: '▲', value: 1 },
                      { label: 'Y', value: 2 },
                    ]}
                    colProps={{ md: 12, xl: 8 }}
                  />
                </ProFormGroup>,

                <ProFormGroup key="common2" title="堆垛机电机铭牌信息">
                  <ProFormText
                    width="md"
                    name="motorManufacturer"
                    label="厂家"
                    colProps={{ md: 12, xl: 8 }}
                  />
                  <ProFormText
                    width="md"
                    name="motorOrderNum"
                    label="订货号"
                    colProps={{ md: 12, xl: 8 }}
                  />
                  <ProFormDigit
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    key="motorVoltage"
                    name="motorVoltage"
                    label="电压(V)"
                  />
                  <ProFormSelect
                    width="md"
                    name="motorWiring"
                    label="接线"
                    options={[
                      { label: '▲', value: 1 },
                      { label: 'Y', value: 2 },
                    ]}
                    colProps={{ md: 12, xl: 8 }}
                  />
                  <ProFormDigit
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="motorPower"
                    label="功率(kw)"
                  />
                  <ProFormDigit
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="motorTorque"
                    label="力矩（伺服）(Nm)"
                  />
                  <ProFormDigit
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="motorCurrent"
                    label="电流(A)"
                  />
                  <ProFormDigit
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="motorSpeed"
                    label="速度(rpm)"
                  />
                  <ProFormDigit
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="motorPowerFactor"
                    label="功率因数"
                  />
                  <ProFormDigit
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="motorFrequency"
                    label="频率(Hz)"
                  />
                  <ProFormSelect
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="motorBrake"
                    label="抱闸"
                    options={[
                      { label: '不带抱闸', value: 0 },
                      { label: '带抱闸', value: 1 },
                    ]}
                  />
                </ProFormGroup>,

                <ProFormGroup key="common3" title="电机编码器信息">
                  <ProFormSelect
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="motorEncoderInterface"
                    label="编码器接口"
                    options={[
                      { label: '端子', value: 1 },
                      { label: 'D-Sub', value: 2 },
                    ]}
                    initialValue={1}
                  />
                  <ProFormText
                    width="md"
                    name="motorEncoderType"
                    label="编码器类型"
                    colProps={{ md: 12, xl: 8 }}
                    initialValue={'1024 HTL A/B R'}
                  />
                  <ProFormSelect
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="motorEncoderSigPolarity"
                    label="信号极性"
                    options={[
                      { label: '单极性', value: 1 },
                      { label: '双极性', value: 2 },
                    ]}
                    initialValue={1}
                  />
                </ProFormGroup>,

                <ProFormGroup key="common4" title="位置编码器信息">
                  <ProFormText
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="posEncoderManufacturer"
                    label="编码器厂家"
                  />
                  <ProFormText
                    width="md"
                    name="posEncoderType"
                    label="型号"
                    colProps={{ md: 12, xl: 8 }}
                  />
                  <ProFormSelect
                    colProps={{ md: 12, xl: 8 }}
                    width="md"
                    name="posEncoderInterface"
                    label="编码器接口"
                    options={[
                      { label: '端子', value: 1 },
                      { label: 'D-Sub', value: 2 },
                    ]}
                    initialValue={2}
                  />
                </ProFormGroup>,
              ];
            } else {
              return [
                <ProFormGroup key="common" title="通用配置项目">
                  <ProFormText
                    width="md"
                    name="shaftName"
                    label="轴名称"
                    colProps={{ md: 12, xl: 8 }}
                    rules={[{ required: true, message: '请输入轴名称信息' }]}
                  />
                  <ProFormText
                    width="md"
                    name="hardwareIdentifier"
                    label="硬件标识符"
                    colProps={{ md: 12, xl: 8 }}
                  />
                  <ProFormSelect
                    width="md"
                    name="driveType"
                    label="驱动类型"
                    options={[
                      { label: 'V90', value: 1 },
                      { label: 'S210', value: 2 },
                    ]}
                    colProps={{ md: 12, xl: 8 }}
                    fieldProps={{
                      onChange: (val, val2) => {
                        formRef.current?.setFieldsValue({ motorOrderNum: null, ...rowNullData });
                      },
                    }}
                    rules={[{ required: true, message: '此项是必填项目' }]}
                  />

                  <ProFormDependency name={['driveType']}>
                    {({ driveType }) => {
                      if (driveType == 1) {
                        return (
                          <ProFormSelect
                            showSearch
                            width="md"
                            name="motorOrderNum"
                            label="V90电机订货号"
                            placeholder={'请输入前5个连续字符进行检索'}
                            colProps={{ md: 12, xl: 16 }}
                            debounceTime={1000}
                            request={async (params) => {
                              const result = await getV90motorList({ blurry: params.keyWords });
                              result.data.push({ motorOrderNum: '第三方', id: '第三方' });
                              return result.data.map((item) => {
                                return {
                                  key: item.id,
                                  label: item.motorOrderNum,
                                  value: item.motorOrderNum,
                                  rowData: item,
                                };
                              });
                            }}
                            fieldProps={{
                              onChange: (val, child) => {
                                formRef.current?.setFieldsValue({
                                  ...rowNullData,
                                  ...child.rowData,
                                });
                              },
                            }}
                          />
                        );
                      } else {
                        return (
                          <ProFormSelect
                            showSearch
                            width="md"
                            name="motorOrderNum"
                            label="S210电机订货号"
                            placeholder={'请输入前5个连续字符进行检索'}
                            colProps={{ md: 12, xl: 16 }}
                            debounceTime={1000}
                            request={async (params) => {
                              const result = await getS210motorList({ blurry: params.keyWords });
                              result.data.push({ motorOrderNum: '第三方', id: '第三方' });
                              return result.data.map((item) => {
                                return {
                                  key: item.id,
                                  label: item.motorOrderNum,
                                  value: item.motorOrderNum,
                                  rowData: item,
                                };
                              });
                            }}
                            fieldProps={{
                              onChange: (val, child) => {
                                formRef.current?.setFieldsValue({
                                  ...rowNullData,
                                  ...child.rowData,
                                });
                              },
                            }}
                          />
                        );
                      }
                    }}
                  </ProFormDependency>
                  <ProFormSelect
                    width="md"
                    name="loadType"
                    colProps={{ md: 12, xl: 8 }}
                    label="负载类型"
                    options={[
                      { label: '水平', value: 1 },
                      { label: '旋转', value: 2 },
                      { label: '垂直', value: 3 },
                      // { label: '斜坡', value: 4 },
                      { label: '其它', value: 5 },
                    ]}
                  />
                  <ProFormSelect
                    width="md"
                    name="mechanicalStructure"
                    label="机械结构"
                    colProps={{ md: 12, xl: 8 }}
                    options={[
                      { label: '丝杠', value: 1 },
                      // { label: '齿轮齿条', value: 2 },
                      { label: '皮带轮', value: 3 },
                      { label: '圆盘', value: 4 },
                      // { label: '辊式带', value: 5 },
                      // { label: '链条', value: 6 },
                      { label: '其它', value: 7 },
                    ]}
                  />
                  <ProFormSelect
                    width="md"
                    name="controlMode"
                    label="控制模式"
                    colProps={{ md: 12, xl: 8 }}
                    options={[
                      { label: 'TO', value: 1 },
                      { label: 'Epos', value: 2 },
                      { label: 'Speed', value: 3 },
                    ]}
                  />
                  <ProFormSelect
                    width="md"
                    name="commTelegram"
                    label="通讯报文"
                    colProps={{ md: 12, xl: 8 }}
                    options={[
                      { label: '105', value: 105 },
                      { label: '111', value: 111 },
                      { label: '102', value: 102 },
                      { label: '3', value: 3 },
                      { label: '1', value: 1 },
                    ]}
                  />
                  <ProFormSelect
                    width="md"
                    name="additionalTelegram"
                    label="附加报文"
                    colProps={{ md: 12, xl: 8 }}
                    options={[
                      { label: 'None', value: 999 },
                      { label: '750', value: 750 },
                    ]}
                  />
                  {/* <ProFormSelect
                    width="md"
                    name="motorRotation"
                    label="电机方向"
                    colProps={{ md: 12, xl: 8 }}
                    options={[
                      { label: '正向', value: 0 },
                      { label: '反向', value: 1 },
                    ]}
                  /> */}
                </ProFormGroup>,

                <ProFormGroup key="common2" title="电机基本信息">
                  <ProFormDependency name={['motorOrderNum']}>
                    {({ motorOrderNum }) => {
                      if (motorOrderNum == '第三方') {
                        return [
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="motorId"
                            name="motorId"
                            label="电机ID"
                          />,
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="ratedCurrent"
                            name="ratedCurrent"
                            label="额定电流(A)"
                          />,
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="ratedTorque"
                            name="ratedTorque"
                            label="额定扭矩(Nm)"
                          />,
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="ratedPower"
                            name="ratedPower"
                            label="额定功率(KW)"
                          />,
                          <ProFormSelect
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            name="ecoderType"
                            key="ecoderType"
                            label="编码器"
                            options={[
                              { label: '单圈绝对编码器', value: 0 },
                              { label: '多圈绝对编码器', value: 1 },
                              { label: '增量式编码器', value: 2 },
                            ]}
                          />,
                          <ProFormSelect
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            name="brake"
                            key="brake"
                            label="抱闸"
                            options={[
                              { label: '不带抱闸', value: 0 },
                              { label: '带抱闸', value: 1 },
                            ]}
                          />,
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="ratedSpeed"
                            name="ratedSpeed"
                            label="额定速度(rpm)"
                          />,
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="ratedVoltage"
                            name="ratedVoltage"
                            label="额定电压(V)"
                          />,
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="motorInertia"
                            name="motorInertia"
                            label="电机惯量(10^-4kg·cm2)"
                          />,
                        ];
                      } else {
                        return [
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="motorId"
                            name="motorId"
                            disabled={true}
                            label="电机ID"
                          />,
                          <ProFormDigit
                            width="md"
                            colProps={{ md: 12, xl: 8 }}
                            name="ratedCurrent"
                            key="ratedCurrent"
                            disabled={true}
                            label="额定电流(A)"
                          />,
                          <ProFormDigit
                            width="md"
                            colProps={{ md: 12, xl: 8 }}
                            key="ratedTorque"
                            disabled={true}
                            name="ratedTorque"
                            label="额定扭矩(Nm)"
                          />,
                          <ProFormDigit
                            width="md"
                            colProps={{ md: 12, xl: 8 }}
                            key="ratedPower"
                            disabled={true}
                            name="ratedPower"
                            label="额定功率(KW)"
                          />,
                          <ProFormSelect
                            width="md"
                            name="ecoderType"
                            colProps={{ md: 12, xl: 8 }}
                            label="编码器"
                            key="ecoderType"
                            disabled={true}
                            options={[
                              { label: '单圈绝对编码器', value: 0 },
                              { label: '多圈绝对编码器', value: 1 },
                              { label: '增量式编码器', value: 2 },
                            ]}
                          />,
                          <ProFormSelect
                            width="md"
                            colProps={{ md: 12, xl: 8 }}
                            name="brake"
                            key="brake"
                            label="抱闸"
                            disabled={true}
                            options={[
                              { label: '不带抱闸', value: 0 },
                              { label: '带抱闸', value: 1 },
                            ]}
                          />,
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="ratedSpeed"
                            name="ratedSpeed"
                            disabled={true}
                            label="额定速度(rpm)"
                          />,
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="ratedVoltage"
                            name="ratedVoltage"
                            disabled={true}
                            label="额定电压(V)"
                          />,
                          <ProFormDigit
                            colProps={{ md: 12, xl: 8 }}
                            width="md"
                            key="motorInertia"
                            name="motorInertia"
                            disabled={true}
                            label="电机惯量(10^-4kg·cm2)"
                          />,
                        ];
                      }
                    }}
                  </ProFormDependency>
                </ProFormGroup>,

                <ProFormGroup key="common3" title="工艺参数">
                  <ProFormDependency name={['controlMode']}>
                    {({ controlMode }) => {
                      if (controlMode == 2) {
                        return (
                          <ProCard
                            tabs={{
                              type: 'card',
                            }}
                            layout="center"
                          >
                            <ProCard.TabPane key="tab1-1" tab="V90 Epos模式" style={{ margin: 16 }}>
                              <ProForm.Group>
                                <ProFormDigit
                                  width="md"
                                  colProps={{ md: 12, xl: 12 }}
                                  name="gearRationMotor"
                                  label="齿轮比电机(V90 EPOS)"
                                />
                                <ProFormDigit
                                  width="md"
                                  colProps={{ md: 12, xl: 12 }}
                                  name="gearRationLoad"
                                  label="齿轮比负载(V90 EPOS)"
                                />
                                <ProFormDigit
                                  width="md"
                                  colProps={{ md: 12, xl: 12 }}
                                  name="loadOneTurnDistance"
                                  label="负载一圈的距离(V90 EPOS) （mm/°）"
                                />
                                <ProFormDigit
                                  width="md"
                                  hidden={props.isDriveParaCalc}
                                  colProps={{ md: 12, xl: 12 }}
                                  name="velocityMax"
                                  label="设备最大速度Vmax(V90 EPOS)（m/s）"
                                />
                                <ProFormDigit
                                  width="md"
                                  hidden={!props.isDriveParaCalc}
                                  colProps={{ md: 12, xl: 12 }}
                                  name="vmaxEpos"
                                  label="设备最大速度Vmax(V90 EPOS)（m/s）"
                                />
                                <ProFormSelect
                                  width="md"
                                  name="increaseTimeEpos"
                                  colProps={{ md: 12, xl: 12 }}
                                  label="0-Vmax时间(V90 EPOS) （s）"
                                  options={[
                                    { label: '<0.05', value: 1 },
                                    { label: '0.05-0.09', value: 2 },
                                    { label: '0.1-0.2', value: 3 },
                                    { label: '0.25-0.4', value: 4 },
                                    { label: '0.45-0.9', value: 5 },
                                    { label: '1.0-2.0', value: 6 },
                                    { label: '2.0-4.0', value: 7 },
                                    { label: '>4.0', value: 8 },
                                  ]}
                                />
                                <ProFormSelect
                                  width="md"
                                  name="decreaseTimeEpos"
                                  colProps={{ md: 12, xl: 12 }}
                                  label="Vmax-0时间(V90 EPOS) （s）"
                                  options={[
                                    { label: '<0.05', value: 1 },
                                    { label: '0.05-0.09', value: 2 },
                                    { label: '0.1-0.2', value: 3 },
                                    { label: '0.25-0.4', value: 4 },
                                    { label: '0.45-0.9', value: 5 },
                                    { label: '1.0-2.0', value: 6 },
                                    { label: '2.0-4.0', value: 7 },
                                    { label: '>4.0', value: 8 },
                                  ]}
                                />
                              </ProForm.Group>
                            </ProCard.TabPane>
                            <ProCard.TabPane
                              key="tab1-2"
                              tab="V90/S210 TO模式"
                              style={{ margin: 16 }}
                              disabled
                            ></ProCard.TabPane>
                            <ProCard.TabPane
                              key="tab1-3"
                              tab="V90速度控制模式"
                              style={{ margin: 16 }}
                              disabled
                            ></ProCard.TabPane>
                          </ProCard>
                        );
                      } else if (controlMode == 1) {
                        return (
                          <ProCard
                            tabs={{
                              type: 'card',
                            }}
                            layout="center"
                          >
                            <ProCard.TabPane
                              key="tab2-1"
                              tab="V90 Epos模式"
                              style={{ margin: 16 }}
                              disabled
                            ></ProCard.TabPane>
                            <ProCard.TabPane
                              key="tab2-2"
                              tab="V90/S210 TO模式"
                              style={{ margin: 16 }}
                            ></ProCard.TabPane>
                            <ProCard.TabPane
                              key="tab2-3"
                              tab="V90速度控制模式"
                              style={{ margin: 16 }}
                              disabled
                            ></ProCard.TabPane>
                          </ProCard>
                        );
                      } else {
                        return (
                          <ProCard
                            tabs={{
                              type: 'card',
                            }}
                            layout="center"
                          >
                            <ProCard.TabPane
                              key="tab3-1"
                              tab="V90 Epos模式"
                              style={{ margin: 16 }}
                              disabled
                            ></ProCard.TabPane>
                            <ProCard.TabPane
                              key="tab3-2"
                              tab="V90/S210 TO模式"
                              style={{ margin: 16 }}
                              disabled
                            ></ProCard.TabPane>
                            <ProCard.TabPane
                              key="tab3-3"
                              tab="V90速度控制模式"
                              style={{ margin: 16 }}
                            ></ProCard.TabPane>
                          </ProCard>
                        );
                      }
                    }}
                  </ProFormDependency>
                </ProFormGroup>,
              ];
            }
          }}
        </ProFormDependency>
      </ModalForm>
      {/* </Modal> */}
    </div>
  );
};
const DriveParaCalcCommon = forwardRef<unknown, FormDialogProps>(DriveParaCalc);

export default DriveParaCalcCommon;
